import request from '@/axios'
import type { ListParams, Response } from '@/api/api'

export interface Row {
  id: number
  no: string
  type: string
  length: string
  color: string
  passenger_num: string
  load_weight: string
  volume: string
  brand: string
  img: string
  remark: string
}

export interface FormData {
  id?: number
  no: string
  type: string
  length: string
  color: string
  passenger_num: string
  load_weight: string
  volume: string
  brand: string
  img: string
  remark: string
}
// 车辆列表
export const getListApi = (data: ListParams): Promise<Response<Row>> => {
  return request.post({ url: '/deliver/car/list', data })
}
// 车辆列表新增
export const createApi = (data: Partial<FormData>): Promise<IResponse> => {
  return request.post({ url: '/deliver/car/create', data })
}
// 车辆列表编辑
export const modifyApi = (data: Partial<FormData>): Promise<IResponse> => {
  return request.post({ url: '/deliver/car/modify', data })
}
// 车辆列表删除
export const delUserApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/deliver/car/del', data })
}
